<template>
  <div class="mindWidth slideMain">
    <div class="block">
      <el-carousel arrow="always" height="120px" v-if="getSwiperList">
        <el-carousel-item v-for="(v, i) in getSwiperList" :key="i">
          <a :href="v.jumpUrl" target="_blank">
            <img :src="imgBaseUrl + v.imageUrl" />
          </a>
        </el-carousel-item>
      </el-carousel>
    </div>
  </div>
</template>

<script>
import { commonRequest, imgBaseUrl } from "../../api/api.js";

export default {
  name: "banner_swipt",
  data() {
    return {
      imgBaseUrl: "",
      getSwiperList: ""
    };
  },
  mounted() {
    this.imgBaseUrl = imgBaseUrl;
    this.getSwiper();
  },
  methods: {
    getSwiper() {
      commonRequest("/api/home/getHomeRotationInfo").then(res => {
        this.getSwiperList = res;
      });
    }
  }
};
</script>

<style lang="less" scoped>
.slideMain {
  margin: 30px auto;

  .slideShow {
    width: 100%;

    img {
      width: 100%;
    }
  }

  .block {
    position: relative;
    z-index: 1;
  }
}
</style>
